<html>

<head>
	<meta charset="UTF-8">
	<title>Registar Utilizador</title>
	<link rel="stylesheet" type="text/css" href="<?php echo base_url('css/style.css');?>">
	<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
	<link href='http://fonts.googleapis.com/css?family=Raleway:300' rel='stylesheet' type='text/css'>
</head>


<body>

	<div class="header">
		<div id="wrapper">
			<div class="logo">
				<h1><a href="<?php echo base_url('/giveaways');?>">GIVEAWAYS</a></h1>
			</div>
			<div class="menu">
				<?php 					
					$this->load->helper("form");

					echo form_open('/giveaways/reg_or_log');

					$data = array (
						"name" => "mail",
						"id" => "mail",
						"value" => "",
						"type" => "email",
						"placeholder" => "E-Mail",
						"onClick" => "if(this.placeholder=='E-Mail')this.placeholder=''",
						"onBlur" => "if(this.placeholder=='')this.placeholder='E-Mail'"
					);
					echo form_input($data);

					$data = array (
						"name" => "pass",
						"id" => "pass",
						"value" => "",
						"type" => "password",
						"placeholder" => "Password",
						"onClick" => "if(this.placeholder=='Password')this.placeholder=''",
						"onBlur" => "if(this.placeholder=='')this.placeholder='Password'"
					);
					echo form_input($data);

					echo form_submit("loginbtn", "Login");
					echo form_submit("registarbtn", "Registar");
					echo validation_errors();

					echo form_close(); 

				?>
			</div>
		</div>
	</div>

	<div class="body">
			<div class="middle-registar">
				<div id="wrapper">
					<div class="registo">REGISTO</div>
					<div class="form2">
						<?php 
							$this->load->helper("form");

							echo form_open('/giveaways/registarbtn');

							echo form_label("Username","user");
							$data = array (
								"name" => "user",
								"id" => "user",
								"value" => "$username",
								"required" => "required",
								"maxlength"   => "20",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Password","pass");
							$data = array (
								"name" => "pass",
								"id" => "pass",
								"required" => "required",
								"type" => "password",
								"maxlength"   => "50",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Nome","nome");
							$data = array (
								"name" => "nome",
								"id" => "nome",
								"value" => "$nome",
								"maxlength"   => "100"
							);
							echo form_input($data);

							echo form_label("E-Mail","mail");
							$data = array (
								"name" => "mail",
								"id" => "mail",
								"value" => "$mail",
								"required" => "required",
								"maxlength"   => "50",
								"type" => "email",
								"placeholder" => "*obrigatório",
								"onClick" => "if(this.placeholder=='*obrigatório')this.placeholder=''",
								"onBlur" => "if(this.placeholder=='')this.placeholder='*obrigatório'"
							);
							echo form_input($data);

							echo form_label("Morada","morada");
							$data = array (
								"name" => "morada",
								"id" => "morada",
								"value" => "$morada",
								"maxlength"   => "100"
							);
							echo form_input($data);

							echo form_label("Nacionalidade","nacional");
							$data = array (
								"name" => "nacional",
								"id" => "nacional",
								"value" => "$nacional",
								"maxlength"   => "20"
							);
							echo form_input($data);

							echo form_label("Telefone","telefone");
							$data = array (
								"name" => "telefone",
								"id" => "telefone",
								"value" => "$telefone",
								"maxlength"   => "13"
							);
							echo form_input($data);
	 
	 						echo form_submit(array("name" => "registarbtn"), "Registar");

							echo form_close(); 

						?>
					</div>
				</div>
			</div>
	</div>

</body>
<script type="text/javascript"> 
	alert ('<?php echo $feedback?>');
</script>
</html>